/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package docmanager.operation.sectores;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import bf.operation.Operation;
import bf.operation.OperationException;
import docmanager.business.objects.Sector;
import docmanager.db.ConnectionPool;

/**
 *
 * @author Jose Luis
 */
public class OpModificarSector1 extends Operation
{

        @Override
    public Map execute(HttpServletRequest request) throws OperationException
    {
        try
        {
            Map m = new HashMap();
            m.put("accion", "modificacion");
            Connection conn = ConnectionPool.getConnection();
            int id = Integer.parseInt((String)request.getParameter("id"));
            Sector sector = new Sector(conn,id);
            m.put("sector", sector);
            ConnectionPool.closeConn(conn);
            return m;
        } catch (SQLException sQLException)
        {
            sQLException.printStackTrace();
            throw new OperationException();
        }
    }

    @Override
    public String getReturnURL()
    {
        return "Sectores/AMSectores.jsp";
    }

    
}
